<?php

namespace Yolo\Components\Validator;

use Hyperf\Contract\MessageBag;

interface ValidatorInterface
{

    /**
     * Validate the given data against the provided rules.
     * @param array $rules the rules to validate against
     * @param array $data the data to validate
     * @param array $messages the custom error messages
     * @param array $attributes the custom attributes to validate
     * @return MessageBag|null
     */
    public function validate(array $rules, array $data, array $messages = [], array $attributes = []): ?MessageBag;
}
